package studentPackage;

public class PartTimeStudent implements Student {
	
	private String firstName;
	private String lastName;
	private boolean hasTax;
	private boolean isGraduate;
	private int programId;
	private int yearOfStudy;
	
	public PartTimeStudent() {
		
		this.firstName = null;
		this.lastName = null;
		this.hasTax = false;
		this.isGraduate = false;
		this.programId = 0;
		this.yearOfStudy = 0;
		
	}

	public PartTimeStudent(String firstName, String lastName, boolean hasTax,
			boolean isGraduate, int programId, int yearOfStudy) {
		
		this.firstName = firstName;
		this.lastName = lastName;
		this.hasTax = hasTax;
		this.isGraduate = isGraduate;
		this.programId = programId;
		this.yearOfStudy = yearOfStudy;
		
	}
	
	/*Metode getter*/
	public String getFirstName() {
		return firstName;
	}
	
	public String getLastName() {
		return lastName;
	}
	
	public boolean getHasTax() {
		return hasTax;
	}
	
	public boolean getIsGraduate() {
		return this.isGraduate;
	}
	
	public int getProgramId() {
		return programId;
	}
	
	public int getYearOfStudy() {
		return yearOfStudy;
	}
	
	/*Metode setter*/
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public void setHasTax(boolean hasTax) {
		this.hasTax = hasTax;
	}
	
	public void setIsGraduate(boolean isGraduate) {
		this.isGraduate = isGraduate;
	}

	public void setProgramId(int programId) {
		this.programId = programId;
	}

	public void setYearOfStudy(int yearOfStudy) {
		this.yearOfStudy = yearOfStudy;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((firstName == null) ? 0 : firstName.hashCode());
		result = prime * result + (hasTax ? 1231 : 1237);
		result = prime * result + (isGraduate ? 1231 : 1237);
		result = prime * result
				+ ((lastName == null) ? 0 : lastName.hashCode());
		result = prime * result + programId;
		result = prime * result + yearOfStudy;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PartTimeStudent other = (PartTimeStudent) obj;
		if (firstName == null) {
			if (other.firstName != null)
				return false;
		} else if (!firstName.equals(other.firstName))
			return false;
		if (hasTax != other.hasTax)
			return false;
		if (isGraduate != other.isGraduate)
			return false;
		if (lastName == null) {
			if (other.lastName != null)
				return false;
		} else if (!lastName.equals(other.lastName))
			return false;
		if (programId != other.programId)
			return false;
		if (yearOfStudy != other.yearOfStudy)
			return false;
		return true;
	}
	
	public int getHoursPerWeek() {
		return 16;
	}
	
}
